<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <h:head>
        <title>Add a Time Slot</title>
    </h:head>
    <h:body>
        <f:view>
            <h:form>
                <h:outputText value="For Driver:"/>&nbsp;&nbsp;
                <h:selectOneMenu id="driver" value="#{timeSlot.driverID}">
                    <f:selectItems value="#{driver.driversSelect}"/>
                </h:selectOneMenu>
                <br />
                <br />
                <h:panelGrid columns="2" border="1">
                    <h:outputLabel value="Day" for="day" />
                    <h:selectOneMenu id="day" value="#{timeSlot.weekday}">
                        <f:selectItems value="#{timeSlot.weekdays}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="Starting Time" for="startTime" />
                    <h:panelGrid columns="3">
                        <h:selectOneMenu id="startTimeHour" value="#{timeSlot.startHr}">
                            <c:forEach var="i" begin="1" end="12">
                                <f:selectItem itemValue="#{i}" itemLabel="#{i}"/>
                            </c:forEach>
                        </h:selectOneMenu>
                        <h:selectOneMenu id="startTimeMin" value="#{timeSlot.startMin}">
                            <f:selectItem itemValue="0" itemLabel=":00"/>
                            <f:selectItem itemValue="15" itemLabel=":15"/>
                            <f:selectItem itemValue="30" itemLabel=":30"/>
                            <f:selectItem itemValue="45" itemLabel=":45"/>
                        </h:selectOneMenu>
                        <h:selectOneMenu id="startTimeAMPM" value="#{timeSlot.startMer}">
                            <f:selectItem itemValue="AM" itemLabel="AM"/>
                            <f:selectItem itemValue="PM" itemLabel="PM"/>
                        </h:selectOneMenu>
                    </h:panelGrid>
                    <h:outputLabel value="Ending Time" for="endTime" />
                    <h:panelGrid columns="3">
                        <h:selectOneMenu id="endTimeHour" value="#{timeSlot.endHr}">
                            <c:forEach var="i" begin="1" end="12">
                                <f:selectItem itemValue="#{i}" itemLabel="#{i}"/>
                            </c:forEach>
                        </h:selectOneMenu>
                        <h:selectOneMenu id="endTimeMin" value="#{timeSlot.endMin}">
                            <f:selectItem itemValue="0" itemLabel=":00"/>
                            <f:selectItem itemValue="15" itemLabel=":15"/>
                            <f:selectItem itemValue="30" itemLabel=":30"/>
                            <f:selectItem itemValue="45" itemLabel=":45"/>
                        </h:selectOneMenu>
                        <h:selectOneMenu id="endTimeAMPM" value="#{timeSlot.endMer}">
                            <f:selectItem itemValue="AM" itemLabel="AM"/>
                            <f:selectItem itemValue="PM" itemLabel="PM"/>
                        </h:selectOneMenu>
                    </h:panelGrid>
                </h:panelGrid>
                <br />
                <h:outputText value="#{timeSlot.message}"/>
                <br />
                <br />
                <h:commandButton action="#{timeSlot.addTimeSlotPlusLogged}" value="Submit and add another" />
                <br />
                <br />
                <h:commandButton action="#{timeSlot.addTimeSlotLogged}" value="Submit and finish" />
                <br />
                <br />
                <h:commandButton action="timeSlotList" value="Done"/>
            </h:form>
        </f:view>
    </h:body>
</html>
